package com.boat.framework.common.monitor.logs;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.boat.framework.base.setting.EnvProps;
import com.boat.framework.common.monitor.event.BaseMonitorEvent;

/**
 * 业务事件日志打印，日志输出到：${log.appname}_monitor_event.log
 * @author 周江
 *
 */
public class EventLog {
	private static Logger logger = LoggerFactory.getLogger("monitor.event.logger");

	public static void log(BaseMonitorEvent event) {
		try {
			//如果不是基于羽嘉日志就不打印，避免打印到业务日志中
			if (event != null && EnvProps.instance().isBasedOnBoat()) {
				logger.info(event.toString());
			}
		} catch (Exception ex) {
		}
	}
}
